package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_circle_post;

//DAO
public interface U_circle_postMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_CIRCLE_POST  WHERE ID = #{id}")
	public ApiU_circle_post findU_circle_postById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_circle_post")
	public List<ApiU_circle_post> findU_circle_posts();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_circle_postsByMap(HashMap condition);

	// 添加
	// @Insert("INSERT INTO U_CIRCLE_POST (ID, CIRCLE_ID, USER_ID, ADD_TIME,
	// CONTENT, IS_ANONYMOUS, IS_DELETE, LATITUDE, LONGITUDE, EXT1, EXT2, EXT3,
	// EXT4, EXT5) VALUES (SEQT_CIRCLE_POST_ID.nextVal, #{circle_id},
	// #{user_id}, #{add_time}, #{content}, #{is_anonymous}, #{is_delete},
	// #{latitude}, #{longitude}, #{ext1}, #{ext2}, #{ext3}, #{ext4}, #{ext5})")
	// @Options(useGeneratedKeys = false, keyProperty = "id")
	public int insertU_circle_post(ApiU_circle_post u_circle_post);

	// 修改
	@Update("UPDATE U_CIRCLE_POST SET CIRCLE_ID = #{circle_id}, USER_ID = #{user_id}, ADD_TIME = #{add_time,jdbcType=VARCHAR}, post_resource = #{post_resource}, CONTENT = #{content}, IS_ANONYMOUS = #{is_anonymous}, IS_DELETE = #{is_delete}, LATITUDE = #{latitude}, LONGITUDE = #{longitude}, EXT1 = #{ext1}, EXT2 = #{ext2}, EXT3 = #{ext3}, EXT4 = #{ext4}, EXT5 = #{ext5} WHERE ID = #{id}")
	public int updateU_circle_post(ApiU_circle_post u_circle_post);

	// 软删除
	// @Delete("DELETE FROM U_CIRCLE_POST WHERE ID = #{id}")
	@Update("UPDATE U_CIRCLE_POST SET IS_DELETE = 1 WHERE ID = #{id}")
	public int deleteU_circle_post(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
